using System;
using System.Data;
using System.Collections.Generic;
using System.Data.SqlClient;
using Core;

namespace DataAccess
{
    public class MenuWeb : Popular
    {

        public int id { get; set; }
        public string Name { get; set; }
        public int ParentID { get; set; }
        public string Link { get; set; }
        public int OrgID { get; set; }
        Common<MenuWeb> cm = new Common<MenuWeb>();
        
        public bool Insert(Popular b)
        {
            return cm.Insert(b as MenuWeb, "sp_MenuWeb_Insert");
        }
        public bool Update(Popular b)
        {
            return cm.UpDate(b as MenuWeb, "sp_MenuWeb_Update");
        }
        public bool Delete(object b)
        {
            return cm.Delete(b, "sp_MenuWeb_Delete");
        }
        public IDataReader Select_ID(object b)
        {
            return cm.Select_ID(b, "sp_MenuWeb_SelectByID");
        }
        public IDataReader Select_Name(object b)
        {
            return cm.Select_Name(b, "sp_MenuWeb_SelectByName");
        }
        public DataTable Select_Org(object b)
        {
            return DataProvider.Instance.ExecuteDataset("sp_MenuWeb_SelectByOrg", b).Tables[0];
        }
        public IDataReader SelectAll()
        {
            return cm.Select_All("sp_MenuWeb_SelectAll");
        }
        public List<MenuWeb> SelectAllToList()
        {
            return cm.SelectAll<MenuWeb>("sp_MenuWeb_SelectAll");
        }
    }
}